package org.jingouzhui.test.infrastructure;

import lombok.extern.slf4j.Slf4j;
import org.jingouzhui.infrastructure.persistent.redis.IRedisService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.redisson.api.RMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;


/**
 * @description: 测试Redis可用性
 * @author: jingouzhui
 * @date: 2025/4/24 13:44
 */
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class RedisTest {
    @Autowired
    private IRedisService redisService;

    @Test
    public  void  testRedis(){
        RMap<Object, Object> map = redisService.getMap("test");
        map.put(1,101);
        map.put(2,101);
        map.put(3,101);
        map.put(4,102);
        map.put(5,102);
        map.put(6,103);
        map.put(7,104);
        map.put(8,105);
        map.put(9,106);
        map.put(10,107);
        log.info("测试结果:{}",redisService.getFromMap("test",1).toString());
    }
}
